package down.xiaoheihe.work.Controller;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;

@RestController
@MapperScan("down.xiaoheihe.work.Mapper")
@CrossOrigin
public class Exception {
    /**
     * 处理异常
     */
    @GetMapping("/fail")
    public String 登录失败(HttpServletResponse response) {
        response.setStatus(401);
        return "Unauthorized 用户未登录";
    }
}
